home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: Manuel Hernandez <ManuelHe@ix.netcom.com>
- Newsgroups: comp.lang.c++
- Subject: The Ampersand suffix
- Date: 10 Feb 1996 20:54:50 GMT
- Organization: Netcom
- Message-ID: <4fj0mq$q4b@reader2.ix.netcom.com>
- NNTP-Posting-Host: irv-ca7-19.ix.netcom.com
- X-NETCOM-Date: Sat Feb 10 12:54:50 PM PST 1996
-
- Is there such a thing as an ampersand suffix operator. I have seen them
- referred to in texts, though I think that they were actually
- address of operators placed directly after a type declaration and one space
- away from the variable. Here is the example sort of saw. actually I made it up
- just to refer to the use of the &. I dont know if this would
- work, and I dont want to include 100 lines of code on the actual
- program I saw.
-
- struct People
- {
- char name[20];
- int age;
- };
-
- void makeFriends( People& friend)
- {
- cout << "Who will you ask to dinner?" << endl;
- cin.getline(friend.name,20)
- cout << "How old is this person?" << endl;
- cin >> friend.age
- }
-
- void main()
- {
- People friends
- cout << "Lets have a party" << endl;
- makeFriends(friends)
-
-